/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author ARELLANO RODRIGUEZ
 */
@Entity
@Table(name = "requisitos")
@NamedQueries({
    @NamedQuery(name = "Requisitos.findAll", query = "SELECT r FROM Requisitos r"),
    @NamedQuery(name = "Requisitos.findByCorrelativoRequsito", query = "SELECT r FROM Requisitos r WHERE r.requisitosPK.correlativoRequsito = :correlativoRequsito"),
    @NamedQuery(name = "Requisitos.findByItem", query = "SELECT r FROM Requisitos r WHERE r.requisitosPK.item = :item"),
    @NamedQuery(name = "Requisitos.findByCodigoAplicacion", query = "SELECT r FROM Requisitos r WHERE r.codigoAplicacion = :codigoAplicacion"),
    @NamedQuery(name = "Requisitos.findByCodigoHardware", query = "SELECT r FROM Requisitos r WHERE r.codigoHardware = :codigoHardware")})
public class Requisitos implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected RequisitosPK requisitosPK;
    @Column(name = "codigo_aplicacion")
    private Integer codigoAplicacion;
    @Column(name = "codigo_hardware")
    private Integer codigoHardware;

    public Requisitos() {
    }

    public Requisitos(RequisitosPK requisitosPK) {
        this.requisitosPK = requisitosPK;
    }

    public Requisitos(int correlativoRequsito, int item) {
        this.requisitosPK = new RequisitosPK(correlativoRequsito, item);
    }

    public RequisitosPK getRequisitosPK() {
        return requisitosPK;
    }

    public void setRequisitosPK(RequisitosPK requisitosPK) {
        this.requisitosPK = requisitosPK;
    }

    public Integer getCodigoAplicacion() {
        return codigoAplicacion;
    }

    public void setCodigoAplicacion(Integer codigoAplicacion) {
        this.codigoAplicacion = codigoAplicacion;
    }

    public Integer getCodigoHardware() {
        return codigoHardware;
    }

    public void setCodigoHardware(Integer codigoHardware) {
        this.codigoHardware = codigoHardware;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (requisitosPK != null ? requisitosPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Requisitos)) {
            return false;
        }
        Requisitos other = (Requisitos) object;
        if ((this.requisitosPK == null && other.requisitosPK != null) || (this.requisitosPK != null && !this.requisitosPK.equals(other.requisitosPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Requisitos[ requisitosPK=" + requisitosPK + " ]";
    }
    
}
